package com.shiro.forth.authenticator;

import java.util.Arrays;
import java.util.Map;
import java.util.Set;

import org.apache.shiro.authc.pam.ModularRealmAuthenticator;
import org.apache.shiro.realm.Realm;

public class MyAuthenticator extends ModularRealmAuthenticator {
	
	/**
	 * #http://shiro.apache.org/configuration.html#Configuration-Lendahandwithdocumentation
	 * 
	 * 下面这些方法的调用要结合shiro-config-main.ini文件
	 * shiro解释其中的authenticator.bytes=aGVsbG8=时
	 * 将其变成:authenticator.setbytes(Object);调用
	 * @param bytes
	 * Administrator
	 * 2016年8月1日
	 */
	
	public void setBytes(byte[] bytes) {
        System.out.println("Bytes: " +new String(bytes));
    }

    public void setArray(int[] ints) {
        System.out.println("array: " +Arrays.toString(ints));
    }

    public void setSet(Set<Realm> realms) {
        System.out.println("realm: " +realms);
    }

    public void setMap(Map<Object, Object> maps) {
        System.out.println(maps);
        System.out.println(maps.get("1"));
    }
}
